package com.headingdata.operator;

public class OperatorDemo2 {
    public static void main(String[] args) {
        //目标：掌握扩展赋值运算符的使用
        //+=
        //需求：收红包
        double a = 9.5;
        int b = 520;
        a+=b;  // a = (double)(a+b);
        System.out.println(a);

        //-= 发红包
        double i = 300;
        int j = 40;
        i -= j;
        System.out.println(i);

        int m = 10;
        int n = 5;
        m *= n; // 50
        m /= n; // 10
        m %= n; // 0
        System.out.println(m);

        byte x = 10;
        byte y = 30;
//        x = x + y;  编译报错
        x += y;
        System.out.println(x);

    }
}
